/**   
* @Title: BuickContentListAdapter.java 
* @Description: TODO
* @author Mengting Lu   
* @date 2015年8月6日 上午9:30:58 
*/
package com.shanghaionstar.user.adapter;

import android.content.Context;
import android.widget.TextView;

import com.onstar.cn.common.log.LogManager;
import com.onstar.cn.framework.annotation.FindViewById;
import com.onstar.cn.framework.base.CommonAdapter;
import com.onstar.cn.framework.base.CommonViewHolder;
import com.onstar.cn.more.entity.ContentHeaderType;
import com.shanghaionstar.R;

import java.util.List;

/** 
* @ClassName: BuickContentListAdapter 
* @Description: 别克关怀适配器
* @author Mengting Lu
* @date 2015年8月6日 上午9:30:58 
*/
public class BuickContentListAdapter extends CommonAdapter<ContentHeaderType> {
    private Context mContext;
    private List<ContentHeaderType> buicklist ;
    LogManager logger = LogManager.getInstance(mContext);
	/**
	* @Description: TODO
	* @author Mengting Lu
	* @date 2015年8月7日 上午10:28:10 
	*/
	public BuickContentListAdapter(List<ContentHeaderType> datas, Context context) {
		super(datas, context);
		mContext = context;
		buicklist = datas;
	}

	/**
	* (non-Javadoc) 
	* <p>Title: getView</p> 
	* <p>Description: </p> 
	* @param position
	* @param viewHolder 
	* @see com.onstar.cn.framework.base.CommonAdapter#getView(int, com.onstar.cn.framework.base.CommonViewHolder)
	*/
	@Override
	public void getView(int position, CommonViewHolder viewHolder) {
		ViewHolder holder = (ViewHolder)viewHolder;
		ContentHeaderType mContentHeaderList= buicklist.get(position);
	     logger.d("position:"+position+"   "+mContentHeaderList.getTitle());
		holder.item_tv.setText(mContentHeaderList.getTitle());

//		contentview.setBackgroundResource(R.drawable.onstar_assistant_buickcare_list_item_bg);



	}

	/**
	* (non-Javadoc)
	* <p>Title: layoutId</p>
	* <p>Description: </p>
	* @return
	* @see com.onstar.cn.framework.base.CommonAdapter#layoutId()
	*/
	@Override
	public int layoutId() {
		return R.layout.nor_list_item;
	}

	/**
	* (non-Javadoc)
	* <p>Title: getViewHolder</p>
	* <p>Description: </p>
	* @return
	* @see com.onstar.cn.framework.base.CommonAdapter#getViewHolder()
	*/
	@Override
	public CommonViewHolder getViewHolder() {
		return new ViewHolder();
	}
	private class ViewHolder extends CommonViewHolder {
		@FindViewById
		private TextView item_tv;
//		@FindViewById(background = R.drawable.onstar_assistant_buickcare_list_item_bg)
//		private LinearLayout layout_background;
	}

}
